package com.example.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.example.model.entity.Reback;

@Mapper
public interface RebackMapper {

    @Insert("insert into tb_reback(orderId, userId, status, createAt) values(#{orderId}, #{userId}, 'pending', CURRENT_TIMESTAMP)")
    int addReback(@Param("orderId") Integer orderId, @Param("userId") Integer userId);

    @Insert("insert into tb_reback(appointmentId, userId, status, createAt) values(#{appointmentId}, #{userId}, 'pending', CURRENT_TIMESTAMP)")
    int addAppointmentReback(@Param("appointmentId") Integer appointmentId, @Param("userId") Integer userId);

    @Select("select * from tb_reback")
    List<Reback> getListReback();
}
